"""learning_log URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/dev/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""

# 定义learning_logs的URL模式

from django.conf.urls import url

from . import views

urlpatterns = [
	# 主页
    url(r'^$', views.index,name='index'),

    # 显示所有主题
    url(r'^topics/$', views.topics,name='topics'),

    # 显示某个主题下面的笔记
    url(r'^topics/(?P<topic_id>\d+)', views.topic,name='topic'),

    # 添加新的主题
    url(r'^new_topic/$', views.new_topic,name='new_topic'),

    # 添加新的条目
    url(r'^new_entry/(?P<topic_id>\d+)/$', views.new_entry,name='new_entry'),

    # 编辑的条目
    url(r'^edit_entry/(?P<entry_id>\d+)/$', views.edit_entry,name='edit_entry'),
]
